<input type="file" id="file" name="MultipartFile" multiple="multiple">
    <input type="text" name="FileName">
    <input type="submit" onclick="AddUser()" value="提交">
<script>
    function  AddUser(){//修改用户信息
        const file = $("#file")[0].files

        const formData = new FormData();

        formData.append("file",file[0]);
        $.ajax({
            mimeType:'multipart/form-data',
            cache:false,
            async:false,
            url:BaseUrl+"User/file/upload",
            type:"post",
            data:{
                formData
            },
            dataType:"json"
            ,processData:false,
            contentType:false,
            traditional:true
            ,success:function (res){
                var object = JSON.parse(res)
                layer.alert(object.msg)
            }

        })
    }
</script>